package com.iran.tax;

import java.util.ArrayList;
import java.util.List;

public class TaxCuts {
    private List<ATaxItem> list = new ArrayList<>();

    public TaxCuts() {
    }

    public TaxCuts(ATaxItem... item) {
        int length = item.length;
        for (int i = 0; i < length; i++) {
            list.add(item[i]);
        }
    }
    public int sum(){
        int a = 0;
        if (list.isEmpty()){
            return 0;
        }
        for (int i = 0; i < list.size(); i++) {
            a+=list.get(i).getMoney();
        }
        return a;
    }
}
